import { defHttp } from '@/utils/http/axios';
import { LoginParams, LoginResultModel } from './model/auth';

import { ErrorMessageMode } from '#/axios';

export function loginApi(params: LoginParams, mode: ErrorMessageMode = 'message') {
  return defHttp.post<LoginResultModel>(
    {
      url: '/account/auth/login',
      params,
    },
    {
      errorMessageMode: mode,
    },
  );
}

export function logoutAPI() {
  return defHttp.post(
    {
      url: '/account/auth/logout',
    }
  );
}
